import request from '@/utils/request'

// export function login(data) {
//   return request({
//     url: '/vue-admin-template/user/login',
//     method: 'post',
//     data
//   })
// }
export function login(data) {
  return request({
    baseURL:"http://localhost:8080",
    url: '/user/login',
    method: 'post',
    data
  })
}
export function createUser(data) {
  return request({
    baseURL:"http://localhost:8080",
    url: '/user',
    method: 'post',
    data:data
  })
}
export function updateUser(data) {
  return request({
    baseURL:"http://localhost:8080",
    url: '/user/update',
    method: 'put',
    data:data
  })
}
export function deleteUser(row) {
  return request({
    baseURL:"http://localhost:8080",
    url: '/user/delete?id='+row.id,
    method: 'delete',
  })
}


export function getUsers(params) {
  return request({
    baseURL:"http://localhost:8080",
    url: '/user',
    method: 'get',
    params: params
  })
}
export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
